package com.haiheng.voiceandbook.treeview.viewholder;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.MimeTypeMap;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.haiheng.voiceandbook.R;
import com.haiheng.voiceandbook.common.DocDto;
import com.haiheng.voiceandbook.treeview.interfaces.ItemDataClickListener;


import java.io.File;

/**
 * @Author Zheng Haibo
 * @PersonalWebsite http://www.mobctrl.net
 * @Description
 */
public class ChildViewHolder extends BaseViewHolder {

    public TextView text;
    public ImageView image;
    public RelativeLayout relativeLayout;


    public ChildViewHolder(View itemView) {
        super(itemView);
        text = (TextView) itemView.findViewById(R.id.text);
        image = (ImageView) itemView.findViewById(R.id.image);
        relativeLayout = (RelativeLayout) itemView.findViewById(R.id.container);

    }

    public void bindView(final DocDto itemData, int position,  final ItemDataClickListener imageClickListener) {

        text.setText(itemData.getTitle());
        relativeLayout.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View view) {
                imageClickListener.onCilick(itemData);
            }
        });
    }


}
